package com.yuke.cloud.service.uac.dao;

import com.yuke.cloud.common.core.mybatis.MyMapper;
import com.yuke.cloud.service.api.uac.dto.WarehouseAdminUserDto;
import com.yuke.cloud.service.uac.entity.AccUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AccUserMapper extends MyMapper<AccUser> {



    /**
     * Select user info by user id uac user.
     *
     * @param userId the user id
     *
     * @return the uac user
     */
    AccUser selectUserInfoByUserId(@Param("userId") Long userId);
    /**
     * Find by login name uac user.
     *
     * @param loginName the login name
     *
     * @return the uac user
     */
    AccUser findByLoginName(@Param("loginName") String loginName);
    /**
     * Find by openid uac user.
     *
     * @param openid
     *
     * @return the uac user
     */
    AccUser findByOpenId(@Param("openid") String openid);
    /**
     * Find user info by login name uac user.
     *
     * @param loginName the login name
     *
     * @return the uac user
     */
    AccUser findUserInfoByLoginName(@Param("loginName") String loginName);

    /**
     * Find by mobile no acc user.
     *
     * @param mobileNo the mobile no
     *
     * @return the uac user
     */
    AccUser findByMobileNo(@Param("mobileNo") String mobileNo);

    /**
     * 根据组织ID和仓库管理员的角色ID查找与组织关联仓库的管理员
     * @param groupId
     * @param roleId
     * @return
     */
    List<WarehouseAdminUserDto> findWarehousAdminsByGroupId(@Param("groupId") Long groupId, @Param("roleId") Long roleId);

    int updateIsEmployeeByIds(@Param("userIds") List<Long> userIds, @Param("isEmployee") Boolean isEmployee);

    int cancelUserTypeByIds(@Param("userIds") List<Long> userIds, @Param("userType") Integer userType, @Param("isEmployee") Boolean isEmployee);
    int setUserTypeByIds(@Param("userIds") List<Long> userIds, @Param("userType") Integer userType, @Param("isEmployee") Boolean isEmployee);

    /**
     * Select user list list.
     *
     * @param accUser the acc user
     *
     * @return the list
     */
    List<AccUser> selectUserList(AccUser accUser);

    List<AccUser> selectUserInfoByUserIds(@Param("userIds") List<Long> userIds);

    List<AccUser> selectUserInfoByGroupId(@Param("groupId") Long groupId);

    List<AccUser> getUserPageByUserIds(@Param("userIds") List<Long> userIds, @Param("userType") Byte userType);
}